package com.baitengsoft.patentservicemonitor.api.service.impl;

import com.baitengsoft.patentservicemonitor.api.dao.RptInventorDao;
import com.baitengsoft.patentservicemonitor.api.entity.RptInventorEntity;
import com.baitengsoft.patentservicemonitor.api.service.RptInventorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by 周俊 on 2018/1/10.
 */
@Service("RptInventorService")
public class RptInventorImpl implements RptInventorService {
    @Autowired
    RptInventorDao rptInventorDao;

    @Override
    public RptInventorEntity queryRptInventorByQuery(Integer PlatformID, String InventorName) {
        RptInventorEntity entity = rptInventorDao.queryRptInventorByQuery(PlatformID,InventorName);
        return entity;
    }

    @Override
    public void deleteRptInventor(Integer PlatformID) {
        rptInventorDao.deleteRptInventor(PlatformID);
    }

    @Override
    public void addorUpdateRptInventorInfo(RptInventorEntity rptInventorEntity) {
        if (rptInventorEntity.getID() > 0) {//更新数据
            rptInventorDao.update(rptInventorEntity);
        } else {//插入数据
            rptInventorDao.save(rptInventorEntity);
        }
    }
}
